home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 23 Geos Applications / GEMOUS.THD < prev    next >
Text File  |  2019-04-13  |  10KB  |  292 lines

  1. #: 9961 S3/geoProgramming
  2.     13-Aug-92  14:21:20
  3. Sb: #Mouse and Dialog Box
  4. Fm: dennis sherren 74326,3212
  5. To: all
  6.  
  7. Does anyone know how to confine the movement of the mouse to stay within the
  8. boundry of a dialog box? I can confine the mouse outside a dialog box but not
  9. within. I must be missing something. Any hints or tips in this area would be
  10. appreciated!
  11.  
  12. * Reply:        9966
  13.  
  14. #: 9966 S3/geoProgramming
  15.     14-Aug-92  11:15:16
  16. Sb: #9961-#Mouse and Dialog Box
  17. Fm: Joe Buckley/geoSysOp 71570,2600
  18. To: dennis sherren 74326,3212 (X)
  19.  
  20. Dennis,
  21.    I can't recall if I've ever tried to restrict mouse movements to within a
  22. dialog box area, but it should work the same as when outside a DB.
  23.  
  24.    In your definition for the dialog box add a call for your own modifier code
  25. with:
  26.  
  27.    .byte   DB_USR_ROUT
  28.    .word   Your_Routine_Name
  29.  
  30.  
  31.    In you routine, simply:
  32.  
  33. Your_Routine_Name:
  34.    LoadB   mouseTop,Your_DBs_Top_Edge
  35.    LoadB   mouseBottom,Your_DBs_Bottom_Edge
  36.    LoadW   mouseLeft,Your_DBs_Left_Edge
  37.    LoadW   mouseRight,Your_DBs_Right_Edge
  38.    rts
  39.  
  40.    This should work.
  41.    If I recall the use correctly, the mouse should remain within the window
  42. specified and on an attempt to move beyond those boundaries, a call is made
  43. through mouseFaultVec ($84A7).
  44.    You should also be able to determine what type of fault occurred by checking
  45. the value of faultData ($84B6).
  46.    The constants to use are:
  47.  
  48.    SET_OFFTOP       == %10000000
  49.    SET_OFFBOTTOM    == %01000000
  50.    SET_OFFLEFT      == %00100000
  51.    SET_OFFRIGHT     == %00010000
  52.  
  53.    Generally, you wouldn't have to worry about these.
  54.    You also don't need to worry about restoring these values, since they are
  55. preserved by the system and restored upon DB exit by the system.
  56.  
  57.    If there is anything else you may need help on (or if this doesn't work),
  58. feel free to ask.
  59.                                                     Joe
  60.  
  61.  
  62.  
  63.  
  64. * Reply:        9969
  65.  
  66. #: 9969 S3/geoProgramming
  67.     14-Aug-92  16:13:52
  68. Sb: #9966-#Mouse and Dialog Box
  69. Fm: dennis sherren 74326,3212
  70. To: Joe Buckley/geoSysOp 71570,2600 (X)
  71.  
  72. Joe -- Thanks for your timely reply. That is what i have been trying to do,
  73. will reexamine my code and try again. I can get that technique to work outside
  74. of the DB but it seams to not work in the DB. I am using GEOS 128 - 2.0 and am
  75. experimenting with color on the 80 column screen. I have reduxced the screen to
  76. 176 pixel height. However the mouse at times thinks it is still 200 pixels and
  77. blindly wanders of the screen and into the color attribute memory. Makes for
  78. some very interesting unintended color effects. I'll post a note and let you
  79. know how I did.
  80.  
  81. As soon as I get around taht bug I'll have a nice geos program for upload.
  82. Thanks again!
  83.  
  84. Dennis
  85.  
  86. * Replies:      9972, 9974
  87.  
  88. #: 9972 S3/geoProgramming
  89.     14-Aug-92  18:10:44
  90. Sb: #9969-#Mouse and Dialog Box
  91. Fm: dennis sherren 74326,3212
  92. To: dennis sherren 74326,3212 (X)
  93.  
  94. Tried it again and it still doesnt work within a DB. Any other suggestions
  95. would be greatly appreciated.
  96.  
  97. Dennis
  98.  
  99. * Reply:        9976
  100.  
  101. #: 9976 S3/geoProgramming
  102.     14-Aug-92  21:48:00
  103. Sb: #9972-#Mouse and Dialog Box
  104. Fm: Joe Buckley/geoSysOp 71570,2600
  105. To: dennis sherren 74326,3212 (X)
  106.  
  107. Dennis,
  108.         I located the trouble.
  109.         When you use a dialog box, any time you have a system icon in use, the
  110. value of mouseBottom ($84B9) gets reset to 199 ($C7).
  111.         I tracked this down to the call DoDlgBox makes to DoIcons which, in
  112. turn calls a small internal routine to reset the values of mouseTop,
  113. mouseBottom, mouseLeft, and mouseRight to their maximums.
  114.         Why?  I honestly can't say.  The menu handler also calls this routine.
  115.         The easiest, if not the most glamorous, solution is to make a temporary
  116. patch to the kernal to prevent this.
  117.         At the start of you program, preserve the contents of the byte at $FB64
  118. (which is 199, or $C7).  Then simply load this byte with the maximum you wish
  119. to work with.  My program assumes a default mouse pointer, so I use 169 ($A9).
  120.         Just be sure to restore the original value before exiting your program.
  121.         Let me know how this works.
  122.                                                         Joe
  123.  
  124. * Replies:      9977, 9994
  125.  
  126. #: 9977 S3/geoProgramming
  127.     14-Aug-92  21:49:24
  128. Sb: #9976-Mouse and Dialog Box
  129. Fm: Joe Buckley/geoSysOp 71570,2600
  130. To: Joe Buckley/geoSysOp 71570,2600 (X)
  131.  
  132.         BTW, this location is for GEOS 128 V2.0 only.
  133.         I'll try looking it up for V1.4.
  134.  
  135. #: 9994 S3/geoProgramming
  136.     15-Aug-92  17:33:07
  137. Sb: #9976-#Mouse and Dialog Box
  138. Fm: dennis sherren 74326,3212
  139. To: Joe Buckley/geoSysOp 71570,2600 (X)
  140.  
  141. Joe: Many thanks - your suggestion did the trick. The mouse is now well
  142. behaved. I also did a little looking with geoDebugger and I believe the
  143. location to change for Ver. 1.4 ( actually 1.3 in the kernal) is $fb67. Had to
  144. put a little code in for prgram to check which kernal it was running under and
  145. patch accordingly. You also have to undo your patching as you leave the
  146. porgram!! ( I found that out the hard way!)
  147.  
  148. I'm still 'shaking' from having to invoke powerful magic on this program.
  149. Tinkering with the kernal is not for the feeble of heart!
  150.  
  151. Again many, many thanks for your help!
  152.  
  153. Dennis
  154.  
  155. * Reply:        9996
  156.  
  157. #: 9996 S3/geoProgramming
  158.     15-Aug-92  21:35:04
  159. Sb: #9994-#Mouse and Dialog Box
  160. Fm: Joe Buckley/geoSysOp 71570,2600
  161. To: dennis sherren 74326,3212 (X)
  162.  
  163. Dennis,
  164.    Thanks for looking up that data for GEOS 128 V1.3, now I don't have to look
  165. it up! :)
  166.    Yup, it does complicate things checking which kernal version you are
  167. running, but such things are straightforward in execution.
  168.    Restoring temporary patches like this is essential to keeping an even keel!
  169.    BTW, what kind of game is this going to be?  Just curious.
  170.                                                     Joe
  171.  
  172.  
  173.  
  174.  
  175. * Reply:        10000
  176.  
  177. #: 10000 S3/geoProgramming
  178.     16-Aug-92  16:10:38
  179. Sb: #9996-#Mouse and Dialog Box
  180. Fm: dennis sherren 74326,3212
  181. To: Joe Buckley/geoSysOp 71570,2600 (X)
  182.  
  183. If you must know..... <smile> Its a slot machine simulator. But Ive really had
  184. some fun making this thing able to run on Geos 64 and 128 and the 80 column
  185. screen. Call an exercise in compatible programming. It also makes extensive use
  186. of color to brighten things up. And last but not least there is a sound effect
  187. -- the bell rings when you win!
  188.  
  189. Its a silly little program but it has been a good learning experience. With
  190. some luck, a little final polishing i should be able to upload it within a week
  191. or so. I'm happy with it now that the mouse does not wander off the bottom of
  192. the 80 colum screen. Thanks again!
  193.  
  194. Dennis
  195.  
  196. * Replies:      10005, 10007
  197.  
  198. #: 10005 S3/geoProgramming
  199.     16-Aug-92  19:16:24
  200. Sb: #10000-Mouse and Dialog Box
  201. Fm: Bill Roberson/SysOp 73320,1550
  202. To: dennis sherren 74326,3212 (X)
  203.  
  204. Dennis,
  205.  
  206. Congratulations on posting message # 10,000.
  207.  
  208. 8)  Bill  8)
  209.  
  210. #: 10007 S3/geoProgramming
  211.     17-Aug-92  05:39:50
  212. Sb: #10000-#Mouse and Dialog Box
  213. Fm: Joe Buckley/geoSysOp 71570,2600
  214. To: dennis sherren 74326,3212 (X)
  215.  
  216. Dennis,
  217.    Just for curiosity's sake:  I assume there is no improvement that gaining
  218. the 16 scanlines might have?
  219.    When I wrote Parallax, it was originally a 40 column mode/color, using
  220. sprites for a 'startburst' effect.
  221.    Then I said "Let's make an 80 column version", and needed to totally rewrite
  222. the color handler.
  223.    Then I said "Let's put 40/80 column color in one version".  What a pain! I
  224. had to rewrite the color handler again, so I could have the same code drive
  225. both video modes (to cut down code size).
  226.    The game is played on a 19x10 grid, but with 80 column color, the loss of
  227. the 16 scanlines forced me to reduce the grid to 19x9.
  228.    I then rerewrote (!) it so that it would detect the presence of a 64K video
  229. RAM chip set and use the expanded 640x200, 8x8 color cell video mode, giving me
  230. a good simulation of the 40 column screen.
  231.  
  232.    If you have any more programming questions, please ask.
  233.    I must say that I enjoyed this exchange quite a bit.  I have let my GEOS
  234. programming skills get a bit rusty, and found this investigation refreshing.
  235.    Good luck on the rest of the program.  I look forward to seeing the finished
  236. product.
  237.                                                     Joe
  238.  
  239. P.S.
  240.     Congratulations on posting message #10000!
  241.  
  242.  
  243.  
  244.  
  245. * Reply:        10009
  246.  
  247. #: 10009 S3/geoProgramming
  248.     17-Aug-92  18:31:29
  249. Sb: #10007-Mouse and Dialog Box
  250. Fm: dennis sherren 74326,3212
  251. To: Joe Buckley/geoSysOp 71570,2600
  252.  
  253. Well i went into the program trying to design a program which would run on any
  254. C64/128 machine with any GEOS version. So the extra 16 scanlines would have
  255. been nice but I planned around them so I dont really need them. (In fact it
  256. would be nice to whack them off the bottom of the 40 colum screen so it would
  257. be identical to the 80 column!) But thats another exercise for another day.
  258.  
  259. The program is fini! But i am gonna play with it a day or so longer to be sure
  260. there are no hidden bugs. Look for it towards Friday.
  261.  
  262. Dennis
  263.  
  264. PS getting message 10000 was dumb luck! Do I get a prize??
  265.    How about a months worth of Compuserve! Last months bill
  266.    was a lulu! --- That CB channel can be addicting!
  267.  
  268.  
  269.  
  270. #: 9974 S3/geoProgramming
  271.     14-Aug-92  19:43:19
  272. Sb: #9969-Mouse and Dialog Box
  273. Fm: Joe Buckley/geoSysOp 71570,2600
  274. To: dennis sherren 74326,3212 (X)
  275.  
  276. Dennis,
  277.    I've only written two GEOS 128/80 column color programs.  I, too, have seen
  278. the interesting color effects that moving the mouse to the screen bottom
  279. causes.
  280.    I know in one program (PaintView III, an 80 column color geoPaint viewer) I
  281. believe I disabled the mouse pointer, so that wasn't a problem for me.
  282.    In the other (Parallax, a 40/80 column game), I had to keep the mouse from
  283. venturing too far down the screen when using a C128 with only 16K of video RAM.
  284. I don't believe I had any dialog boxes pop up at this point, though its been a
  285. while.
  286.    I'll dig out the program and its code and experiment with it.
  287.    If mouseBottom is decreased to 175, the mouse should stay on the visible
  288. screen.  Remember that mouse position is determined by the 'hot spot' at its
  289. top left corner, so the mouse pointer's 'tail' still droops below the visible
  290. screen.
  291.                                                     Joe
  292.